#!/usr/bin/env node

function Bomb() {
    this.timer = null;
    
    this.start = () => {
      console.log('炸弹启动，3秒后爆炸...');
      this.timer = setTimeout(() => {
        console.log('炸弹爆炸');
      }, 3000);
    };
  
    this.clear = () => {
      clearTimeout(this.timer);
      console.log('炸弹取消');
    };
  }
  
  const b1 = new Bomb();
  const b2 = new Bomb();
  
  b1.start();
  
  b2.start();
  setTimeout(() => {
    b2.clear();
  }, 1000);